﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Infragistics.WebUI.UltraWebListbar;

public partial class index_jxc :PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (_Customer.Competences.IsOwnedCompetences(Competences.Administrator) || _Customer.CustomerTypeID == 0)
        {
            SiteParentItem();   //总商城菜单
        }
        else
        {
            SiteChildItem();    //子商城菜单，已激活会员的菜单
        }
    }

    #region Web 窗体设计器生成的代码

    protected override void OnLoad(EventArgs e)
    {
        isRequestLogin = true;                                  //是否需要登录
        RequestLoginPage = this.Request.Url.AbsoluteUri;        //获取决对Url
        isAtFramePageLogin = true;                              //是框架页

        //RequestCompetences = Competences.BuildCompetencesList(Competences.Jxc);//页面权限

        base.OnLoad(e);
    }

    #endregion

    private void SiteParentItem()
    {
        lbModelName.Text = "进销存管理"; //模块名称

        lbMain.Groups.Clear();

        Group group_xtgg = new Group("采购入库", "g_xtgg");
        setGroupStyle(group_xtgg);
        lbMain.Groups.Add(group_xtgg);
        Items items_xtgg = lbMain.Groups.FromKey("g_xtgg").Items;
        items_xtgg.Clear();

        items_xtgg.Add(new Item("制做采购单", "./images/clearing/9_dian.jpg", "page/Procurement_Manager.aspx?Type=New"));
        items_xtgg.Add(new Item("审核采购单", "./images/clearing/9_dian.jpg", "page/Procurement_Manager.aspx?Type=Check"));
        items_xtgg.Add(new Item("采购单查询", "./images/clearing/9_dian.jpg", "page/Procurement_Manager.aspx?Type=Query"));

      
        Group group_ckgl = new Group("出库管理", "g_ckgl");
        setGroupStyle(group_ckgl);
        lbMain.Groups.Add(group_ckgl);
        Items items_ckgl = lbMain.Groups.FromKey("g_ckgl").Items;
        items_ckgl.Clear();

        items_ckgl.Add(new Item("制做出库单", "./images/clearing/9_dian.jpg", "page/DepotOut_Manager.aspx?Type=New"));
        items_ckgl.Add(new Item("审核出库单", "./images/clearing/9_dian.jpg", "page/DepotOut_Manager.aspx?Type=Check"));
        items_ckgl.Add(new Item("出库单查询", "./images/clearing/9_dian.jpg", "page/DepotOut_Manager.aspx?Type=Query"));

    
        Group group_spgl = new Group("商品管理", "g_spgl");
        setGroupStyle(group_spgl);
        lbMain.Groups.Add(group_spgl);
        Items items_spgl = lbMain.Groups.FromKey("g_spgl").Items;
        items_spgl.Clear();

        items_spgl.Add(new Item("品牌管理", "./images/clearing/9_dian.jpg", "page/Brand_Manager.aspx"));
        items_spgl.Add(new Item("类别管理", "./images/clearing/9_dian.jpg", "page/GoodType_Manager.aspx"));
        items_spgl.Add(new Item("档案管理", "./images/clearing/9_dian.jpg", "page/Good_Manager.aspx"));        
        //items_spgl.Add(new Item("套餐设置", "./images/clearing/9_dian.jpg", "page/Plan_Manager.aspx"));


        Group group_kcgl = new Group("库存管理", "g_kcgl");
        setGroupStyle(group_kcgl);
        lbMain.Groups.Add(group_kcgl);
        Items items_kcgl = lbMain.Groups.FromKey("g_kcgl").Items;
        items_kcgl.Clear();

        items_kcgl.Add(new Item("商品库存", "./images/clearing/9_dian.jpg", "page/ShopStock_Manager.aspx?Type=StockQuery"));


        Group group_jcsj = new Group("基础数据", "g_jcsj");
        setGroupStyle(group_jcsj);
        lbMain.Groups.Add(group_jcsj);
        Items items_jcsj = lbMain.Groups.FromKey("g_jcsj").Items;
        items_jcsj.Clear();

        items_jcsj.Add(new Item("供应商管理", "./images/clearing/9_dian.jpg", "page/Supplier_Manager.aspx"));        
       

        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }

    private void SiteChildItem()
    {
        lbModelName.Text = "网店管理"; //模块名称

        lbMain.Groups.Clear();

        Group group_khzl = new Group("商城管理", "g_khzl");
        setGroupStyle(group_khzl);
        lbMain.Groups.Add(group_khzl);
        Items items_khzl = lbMain.Groups.FromKey("g_khzl").Items;
        items_khzl.Clear();

        items_khzl.Add(new Item("最新订单", "./images/clearing/9_dian.jpg", "shop/index_scwd.aspx"));     
        items_khzl.Add(new Item("商城网店管理", "./images/clearing/9_dian.jpg", "shop/ShopSiteConfig_BaseInfo.aspx"));
        items_khzl.Add(new Item("商城会员", "./images/clearing/9_dian.jpg", "shop/Member_Manager.aspx"));        


        //Group group_xtgg = new Group("添加产品", "g_xtgg");
        //setGroupStyle(group_xtgg);
        //lbMain.Groups.Add(group_xtgg);
        //Items items_xtgg = lbMain.Groups.FromKey("g_xtgg").Items;
        //items_xtgg.Clear();

        //items_xtgg.Add(new Item("采购入库", "./images/clearing/9_dian.jpg", "page/Procurement_Manager.aspx?Type=New"));
        //items_xtgg.Add(new Item("入库管理", "./images/clearing/9_dian.jpg", "page/Procurement_Manager.aspx?Type=Check"));
        //items_xtgg.Add(new Item("产品管理", "./images/clearing/9_dian.jpg", "page/Good_Manager.aspx"));
        //items_xtgg.Add(new Item("商品上架", "./images/clearing/9_dian.jpg", "shop/Good_Manager.aspx?Type=Info"));


        //Group group_rkgl = new Group("进销存统计", "g_rkgl");
        //setGroupStyle(group_rkgl);
        //lbMain.Groups.Add(group_rkgl);
        //Items items_rkgl = lbMain.Groups.FromKey("g_rkgl").Items;
        //items_rkgl.Clear();

        //items_rkgl.Add(new Item("库存统计", "./images/clearing/9_dian.jpg", "page/ShopStock_Manager.aspx?Type=StockQuery"));
        //items_rkgl.Add(new Item("销量统计", "./images/clearing/9_dian.jpg", "page/DepotIN_Manager.aspx?Type=Check"));
    

        Group group_ckgl = new Group("网店资讯管理", "g_ckgl");
        setGroupStyle(group_ckgl);
        lbMain.Groups.Add(group_ckgl);
        Items items_ckgl = lbMain.Groups.FromKey("g_ckgl").Items;
        items_ckgl.Clear();

        items_ckgl.Add(new Item("商品评论", "./images/clearing/9_dian.jpg", "shop/Good_Comments.aspx"));
        items_ckgl.Add(new Item("商品咨询", "./images/clearing/9_dian.jpg", "shop/Good_Advisory.aspx"));
        items_ckgl.Add(new Item("网店信息", "./images/clearing/9_dian.jpg", "shop/ShopSiteConfig_BaseInfo.aspx"));


        Group group_bqdd = new Group("百企订单管理", "g_bqdd");
        setGroupStyle(group_bqdd);
        lbMain.Groups.Add(group_bqdd);
        Items items_bqdd = lbMain.Groups.FromKey("g_bqdd").Items;
        items_bqdd.Clear();

        items_bqdd.Add(new Item("百企订单查询", "./images/clearing/9_dian.jpg", "shop/Order_ManagerSelf.aspx?Type=Query"));


        //Group group_kcgl = new Group("推荐专区订单管理", "g_kcgl");
        //setGroupStyle(group_kcgl);
        //lbMain.Groups.Add(group_kcgl);
        //Items items_kcgl = lbMain.Groups.FromKey("g_kcgl").Items;
        //items_kcgl.Clear();

        //items_kcgl.Add(new Item("确认付款", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Check"));
        //items_kcgl.Add(new Item("订单查询", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Query"));
        //items_kcgl.Add(new Item("订单出库", "./images/clearing/9_dian.jpg", "shop/Order_Manager.aspx?Type=Out"));


        Group group_g = new Group("", "g");
        lbMain.Groups.Add(group_g);
        setGroupStyle(group_g);
        Items items_g = lbMain.Groups.FromKey("g").Items;
        items_g.Clear();
        group_g.Enabled = false;
    }

    private void setGroupStyle(Group group)
    {
        group.Expanded = false;
        group.TextAlign = "left";
        group.ItemAlign = "left";
        group.ImageTextAlign = ImageTextAlign.Middle;
    }
}
